import 'package:flutter_deer/generated/json/base/json_convert_content.dart';
import 'package:flutter_deer/database/beans/employee_list.dart';

EmployeeEntity $EmployeeEntityFromJson(Map<String, dynamic> json) {
  final EmployeeEntity employeeEntity = EmployeeEntity();
  final int? admin = jsonConvert.convert<int>(json['admin']);
  if (admin != null) {
    employeeEntity.admin = admin;
  }
  final String? userId = jsonConvert.convert<String>(json['userId']);
  if (userId != null) {
    employeeEntity.userId = userId;
  }
  final String? userName = jsonConvert.convert<String>(json['userName']);
  if (userName != null) {
    employeeEntity.userName = userName;
  }
  final bool? select = jsonConvert.convert<bool>(json['select']);
  if (select != null) {
    employeeEntity.select = select;
  }
  return employeeEntity;
}

Map<String, dynamic> $EmployeeEntityToJson(EmployeeEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['admin'] = entity.admin;
  data['userId'] = entity.userId;
  data['userName'] = entity.userName;
  data['select'] = entity.select;
  return data;
}

extension EmployeeEntityExtension on EmployeeEntity {
  EmployeeEntity copyWith({
    int? admin,
    String? userId,
    String? userName,
    bool? select,
  }) {
    return EmployeeEntity()
      ..admin = admin ?? this.admin
      ..userId = userId ?? this.userId
      ..userName = userName ?? this.userName
      ..select = select ?? this.select;
  }
}